//
// File:    progtabledelegate.h
// Brief:   测试程序编辑table的delegate头文件
//
// History:
// ============================================================================
// 2010-12-16    Finux Chen <finuxchen@gmail.com>    创建
// 2012-02-18    Finux Chen <finuxchen@gmail.com>    加入suffix处理
//
//
#ifndef _PROGTABLEDELEGATE_H
#define _PROGTABLEDELEGATE_H

#include <QItemDelegate>

class ProgTableDelegate : public QItemDelegate
{
public:
	ProgTableDelegate(QObject *parent = 0);

	QWidget *createEditor(QWidget *parent, const QStyleOptionViewItem &,
						const QModelIndex &index) const;
	void setEditorData(QWidget *editor, const QModelIndex &index) const;
	void setModelData(QWidget *editor, QAbstractItemModel *model,
						const QModelIndex &index) const;

	enum {
		PROG_TABLE_ROW_NAME = 0,
//		PROG_TABLE_ROW_CHANNEL,
		PROG_TABLE_ROW_BIAS,
		PROG_TABLE_ROW_BIAS_UNIT,
		PROG_TABLE_ROW_TIME,
		PROG_TABLE_ROW_MEAS_L,
		PROG_TABLE_ROW_MEAS_U,
		PROG_TABLE_ROW_MEAS_UNIT,
		PROG_TABLE_ROW_FILTER,
		PROG_TABLE_ROW_LIMIT,
		PROG_TABLE_ROW_JUDGE,
		PROG_TABLE_ROW_ACTIVE,
		PROG_TABLE_ROW_COUNT
	};

//private:
//	QString getItemName(const QString& itemSuffix);
};

#endif
